<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 发送请求到后台
        let xhr = new XMLHttpRequest()
        // 当请求的状态改变时候
        xhr.onreadystatechange = function () {
            if (this.readyState == 4 &&this.status ==200) {
                console.log(this.responseText);
            }
        }

        // 设置发送的方法和地址
        xhr.open('GET','http://192.168.134.3:4000/index.html')
        // 直接发送
        xhr.send()
        xhr.onreadystatechange = function () {
            console.log(xhr==this);
            if (xhr.readyState==4&&xhr.status==200) {
                console.log(xhr.responseText);
            }
        }
    </script>
</body>
</html>